package com.elmcode.study.design.pro03_singleton;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;

@Slf4j
public class Singleton {

    @Test
    public void testHungryHanStyle(){
        HungryHanStyle instance01 = HungryHanStyle.getInstance();
        HungryHanStyle instance02 = HungryHanStyle.getInstance();
        System.out.println(instance01);
        System.out.println(instance02);
        System.out.println(instance01 == instance02);
    }


    @Test
    public void testLazyStyle(){
        LazyStyle instance01 = LazyStyle.getInstance();
        LazyStyle instance02 = LazyStyle.getInstance();
        System.out.println(instance01);
        System.out.println(instance02);
        System.out.println(instance01 == instance02);
    }


    @Test
    public void testInnerClassStyle(){
        InnerClassStyle instance01 = InnerClassStyle.getInstance();
        InnerClassStyle instance02 = InnerClassStyle.getInstance();
        System.out.println(instance01);
        System.out.println(instance02);
        System.out.println(instance01 == instance02);
    }

}
